/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

/**
 * <p>Project: jse2303 - For4
 * <p>Powered by webrx On 2023-07-11 15:30:38
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class For5 {
    public static void main(String[] args) {
        int sum = 0;
        for (int i = 2; i <= 100; i++) {
            boolean f = true;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    f = false;
                    break; //出现在循环语句用于结束循环
                }
            }
            //if (f) System.out.print(i + " "); //输出
            if (f) sum += i; //求和
        }
        System.out.println("1-100素数和:" + sum);

    }
}
